package com.jyw.business.obstacles.wechat.controller;

import com.jyw.business.obstacles.domain.ObsOrderEvaluate;
import com.jyw.business.obstacles.domain.dto.wechat.WxCallRecordPageDto;
import com.jyw.business.obstacles.domain.vo.wechat.WxCallRecordPageVO;
import com.jyw.business.obstacles.service.IObsOrderInfoService;
import com.jyw.common.core.controller.BaseController;
import com.jyw.common.core.domain.CommonResult;
import com.jyw.common.core.page.TableDataInfo;
import com.jyw.system.domain.vo.UserCacheVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Created by ZhangCheng on 2023/09/05 （微信通话记录）
 */
@RestController
@RequestMapping("/wechat/callRecord")
@Api(tags = "通话记录")
public class ObsWxCallRecordController extends BaseController {

    @Resource
    private IObsOrderInfoService orderInfoService;

    /**
     * 分页查询通话记录列表
     *
     * @param wxCallRecordPageDto
     * @return
     */
    @PostMapping("/pageList")
    @ApiOperation("分页查询通话记录列表")
    public TableDataInfo<WxCallRecordPageVO> pageList(@RequestBody WxCallRecordPageDto wxCallRecordPageDto) {
        startPage();
        List<WxCallRecordPageVO> list = orderInfoService.selectWxRecordList(wxCallRecordPageDto);
        return getDataTable(list);
    }

    @GetMapping("/serverUser")
    @ApiOperation("服务台坐席人员")
    public CommonResult<List<UserCacheVo>> userList(){
        return CommonResult.success(orderInfoService.serverUser());
    }
}
